home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Harvest C / MPW Int & Lib / Interfaces / Time.h < prev    next >
Text File  |  1991-04-17  |  2KB  |  77 lines

  1. /************************************************************
  2.  
  3.     Time.h
  4.     Date and time
  5.     
  6.     Copyright © Apple Computer,Inc.  1987-1990.
  7.     All Rights Reserved.
  8.  
  9. ************************************************************/
  10.  
  11.  
  12. #ifndef __TIME_H__ /* __TIME__ is a reserved preprocessor symbol */
  13. #define __TIME_H__
  14.  
  15. #define NULL 0
  16.  
  17. #ifndef __size_t__
  18. #define __size_t__
  19. typedef unsigned int size_t;
  20. #endif
  21.  
  22. /*
  23.  *    Declarations
  24.  */
  25.  
  26. #define CLOCKS_PER_SEC 60
  27. typedef unsigned long int clock_t;
  28. typedef unsigned long int time_t;
  29. struct tm {
  30.     int tm_sec;        /* Seconds after the minute -- [0, 61] */
  31.     int tm_min;        /* Minutes after the hour -- [0, 59] */
  32.     int tm_hour;    /* Hours after midnight -- [0, 23] */
  33.     int tm_mday;    /* Day of the month -- [1, 31] */
  34.     int tm_mon;        /* Months since January -- [0, 11] */
  35.     int tm_year;    /* Years since 1900 */
  36.     int tm_wday;    /* Days since Sunday -- [0, 6] */
  37.     int tm_yday;    /* Days since January 1 -- [0, 365] */
  38.     int tm_isdst;    /* Daylight Savings Time flag */
  39. };
  40.  
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44.  
  45. /*
  46.  *    Time manipulation functions
  47.  */
  48.  
  49. clock_t clock(void);                        /* function */
  50. #define clock() __tickcount()                /* macro - TickCount() */
  51. pascal unsigned long __tickcount(void)
  52.     = 0xA975; 
  53.  
  54. double  difftime(time_t time1, time_t time0);                /* function */
  55. #define difftime(time1,time0) ((long double)time1 - time0)    /* macro */
  56.  
  57. time_t mktime(struct tm *timeptr);
  58. time_t time(time_t *timer);
  59.  
  60.  
  61. /*
  62.  *    Time conversion functions
  63.  */
  64.  
  65. char *asctime (const struct tm *timeptr);
  66. char *ctime(const time_t *timer);
  67. struct tm *gmtime(const time_t *timer);
  68. struct tm *localtime(const time_t *timer);
  69. size_t strftime(char *s, size_t maxsize,
  70.                  const char *format, const struct tm *timerptr);
  71.  
  72. #ifdef __cplusplus
  73. }
  74. #endif
  75.  
  76. #endif
  77.